package site.beanyon.now.model.dto;

import site.beanyon.now.model.po.UserPO;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户传输描述类
 */
public class UserDTO implements Serializable {
    /**
     * 主键id
     */
    private Integer id;

    /**
     * 用户名
     */
    private String name;

    /**
     * 登录账号/手机号码
     */
    private String tel;

    /**
     * 性别
     */
    private Byte gender;

    /**
     * 生日
     */
    private Date birthday;

    /**
     * 状态（1：正常，0：不可用，默认为1）
     */
    private Byte status;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 会话id
     */
    private String sessionId;

    public UserDTO(String name, String tel, Byte gender, Date birthday) {
        this.name = name;
        this.tel = tel;
        this.gender = gender;
        this.birthday = birthday;
    }

    public UserDTO(Integer id, String name, String tel, Byte gender, Date birthday, Byte status, Date createdAt) {
        this.id = id;
        this.name = name;
        this.tel = tel;
        this.gender = gender;
        this.birthday = birthday;
        this.status = status;
        this.createdAt = createdAt;
    }

    public UserDTO(UserPO userPO) {
        this.id = userPO.getId();
        this.name = userPO.getName();
        this.tel = userPO.getTel();
        this.gender = userPO.getGender();
        this.birthday = userPO.getBirthday();
        this.status = userPO.getStatus();
        this.createdAt = userPO.getCreatedAt();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public Byte getGender() {
        return gender;
    }

    public void setGender(Byte gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    @Override
    public String toString() {
        return "UserDTO{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", tel='" + tel + '\'' +
                ", gender=" + gender +
                ", birthday=" + birthday +
                ", status=" + status +
                ", createdAt=" + createdAt +
                ", sessionId='" + sessionId + '\'' +
                '}';
    }
}
